<template>
  <div class="skeleton">
    <van-skeleton :title="title" :avatar="avatar" :row="row" :loading="loading">
      <slot></slot>
    </van-skeleton>
    <div v-for="i in (count-1)" v-if="loading">
      <empty-line height="24px"/>
      <van-skeleton :title="title" :avatar="avatar" :row="row" :loading="loading"/>
    </div>
  </div>
</template>

<script>
import EmptyLine from "@/components/EmptyLine"
export default {
  components: {
    EmptyLine
  },
  name: "PageSkeleton",
  props: {
    count: {
      type: Number,
      default: 3
    },
    title: {
      type: Boolean,
      default: false
    },
    avatar: {
      type: Boolean,
      default: false
    },
    loading: {
      type: Boolean,
      default: true
    },
    row: {
      type: Number,
      default: 3
    }
  },
}
</script>

<style scoped>
.skeleton {
  background-color: white;
  width: 100%
}
</style>